package com.qls.ali.model.dto.rp.request;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.nacos.api.utils.StringUtils;

import java.io.Serializable;

/**
 * @author doyoung
 */
public class PushRp implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 外部酒店id
     */
    @JSONField(name = "out_hid")
    private String hotelCode;

    /**
     * 外部房型id
     */
    @JSONField(name = "out_rid")
    private String roomCode;

    /**
     * 卖家自己系统的Code
     */
    @JSONField(name = "rateplan_code")
    private String rpCode;

    /**
     * 在淘宝搜索页面展示的房价名称
     */
    @JSONField(name = "name")
    private String rpName;

    /**
     * 支付类型，只支持：1：预付5：现付6: 信用住7:预付在线预约8:信用住在线预约
     */
    @JSONField(name = "payment_type")
    private Integer paymentType = 1;

    /**
     * -1：状态早餐,有具体几人价有关系，几人价是几份早餐;0：不含早1：含单早2：含双早N：含N早（-1-99可选）
     */
    @JSONField(name = "breakfast_count")
    private Integer breakfastCount;

    /**
     * 最小入住天数（1-90）。默认1,小时房RP请设置为1
     */
    @JSONField(name = "min_days")
    private Integer minDays;

    /**
     * 最大入住天数（1-90）。默认90 信用住不超过9天,小时房RP请设置为1
     */
    @JSONField(name = "max_days")
    private Integer maxDays;

    /**
     * 最小提前预定小时数，从入住当天的24点往前计算。例如如果这个字段设置了48，代表必须至少提前两天预定，那么如果想预定24号入住，,必须在23号零点前下单。
     */
    @JSONField(name = "min_adv_hours")
    private Integer minAdvHours;

    /**
     * 最大提前预定小时数，从入住当天的24点往前计算。例如如果这个字段设置了48，代表最多提前两天预定，那么如果想预定24号入住，,必须在23号零点以后下单。
     */
    @JSONField(name = "max_adv_hours")
    private Integer maxAdvHours;

    /**
     * 退订政策字段，是个json串
     */
    @JSONField(name = "cancel_policy")
    private String cancelPolicy;

    /**
     * 1：开启（默认）2：关闭。如果没传值那么默认默认值为1
     */
    private Integer status;

    /**
     * 销售渠道。如需开通，需要申请权限。目前支持的渠道有 H:飞猪 O:钉钉商旅 A:集团内部商旅。如果只投放飞猪，改字段不用填写或者只填H；如果有多个用","分开。如果需要投放其他渠道，请联系飞猪运营或者技术支持。
     */
    private String channel;

    /**
     * 在添加rateplan时，同时新增早餐日历。date：说明这条记录的早餐政策breakfast_count：这一天早餐的数量。>=-1,<=99。如果date为空，那么会去读取startDate和endDate（格式都为"yyyy-MM-dd"），即早餐正常属于一个时间段。-1为状态早餐，和最终绑定的几人价有关，如果是一人价那么就是我一份早餐，二人价就是两份早餐。请注意，该字段仅能维护从当前时间开始，10年以内的数据，如果超过10年，会报错。
     */
    @JSONField(name = "breakfast_cal")
    private String breakfastCal;

    /**
     * 在新增rateplan的同时新增取消政策日历。 json格式
     */
    @JSONField(name = "cancel_policy_cal")
    private String cancelPolicyCal;

    @JSONField(name = "resource_type")
    private Integer resourceType = 3;

    public Integer getResourceType() {
        return resourceType;
    }

    public void setResourceType(Integer resourceType) {
        this.resourceType = resourceType;
    }

    public String getHotelCode() {
        return hotelCode;
    }

    public void setHotelCode(String hotelCode) {
        this.hotelCode = hotelCode;
    }

    public String getRoomCode() {
        return roomCode;
    }

    public void setRoomCode(String roomCode) {
        this.roomCode = roomCode;
    }

    public String getRpCode() {
        return rpCode;
    }

    public void setRpCode(String rpCode) {
        this.rpCode = rpCode;
    }

    public String getRpName() {
        return rpName;
    }

    public void setRpName(String rpName) {
        if (StringUtils.isBlank(rpName)) {
            rpName = "全额预付";
        }
        if (rpName.length() > 64) {
            rpName = rpName.substring(0, 64);
        }
        this.rpName = rpName;
    }

    public Integer getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(Integer paymentType) {
        this.paymentType = paymentType;
    }

    public Integer getBreakfastCount() {
        return breakfastCount;
    }

    public void setBreakfastCount(Integer breakfastCount) {
        this.breakfastCount = breakfastCount;
    }

    public Integer getMinDays() {
        return minDays;
    }

    public void setMinDays(Integer minDays) {
        this.minDays = minDays;
    }

    public Integer getMaxDays() {
        return maxDays;
    }

    public void setMaxDays(Integer maxDays) {
        this.maxDays = maxDays;
    }

    public Integer getMinAdvHours() {
        return minAdvHours;
    }

    public void setMinAdvHours(Integer minAdvHours) {
        this.minAdvHours = minAdvHours;
    }

    public Integer getMaxAdvHours() {
        return maxAdvHours;
    }

    public void setMaxAdvHours(Integer maxAdvHours) {
        this.maxAdvHours = maxAdvHours;
    }

    public String getCancelPolicy() {
        return cancelPolicy;
    }

    public void setCancelPolicy(String cancelPolicy) {
        this.cancelPolicy = cancelPolicy;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getBreakfastCal() {
        return breakfastCal;
    }

    public void setBreakfastCal(String breakfastCal) {
        this.breakfastCal = breakfastCal;
    }

    public String getCancelPolicyCal() {
        return cancelPolicyCal;
    }

    public void setCancelPolicyCal(String cancelPolicyCal) {
        this.cancelPolicyCal = cancelPolicyCal;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "PushRp{" +
                "hotelCode='" + hotelCode + '\'' +
                ", roomCode='" + roomCode + '\'' +
                ", rpCode='" + rpCode + '\'' +
                ", rpName='" + rpName + '\'' +
                ", paymentType=" + paymentType +
                ", breakfastCount=" + breakfastCount +
                ", minDays=" + minDays +
                ", maxDays=" + maxDays +
                ", minAdvHours=" + minAdvHours +
                ", maxAdvHours=" + maxAdvHours +
                ", cancelPolicy='" + cancelPolicy + '\'' +
                ", status=" + status +
                ", channel='" + channel + '\'' +
                ", breakfastCal='" + breakfastCal + '\'' +
                ", cancelPolicyCal='" + cancelPolicyCal + '\'' +
                '}';
    }
}
